package com.kevin.netty.protocol.binary;

import lombok.Getter;

@Getter
public enum RequestType {

    UNKNOWN((byte) 0xFF, "未知类型"),
    NOTICE((byte) 0x01, "通知消息"),
    ;

    private final byte value;
    private final String description;

    RequestType(byte value, String description) {
        this.value = value;
        this.description = description;
    }

    public static RequestType valueOf(byte type) {
        for (RequestType t : values()) {
            if (t.value == type) {
                return t;
            }
        }
        return UNKNOWN;
    }

}
